<template>
	<view style="background-color: #F5F5F5;height: 100vh;">
		<view class="header" :style="'padding-top: '+bartop+'px; padding-bottom:10rpx'">
			<view class="goodsmsgheader headertop" style="width: 100%;">
				<navigator open-type="navigateBack"  style="padding:10rpx">
					<image src="https://x.bilinmeiju.com/static/myfangchan/zjt.png" mode="aspectFit"></image>
				</navigator>
				<text>{{data.formattype}}</text>
				<!-- <image src="/static/goodsmsghei.png" mode="aspectFit" bindtap="showmsg" wx:if="{{cartlen=='00'?false:true}}"><text>{{cartlen}}</text></image> -->
			</view>
		</view>
		<view class="" style="width: 100vw;height: 180rpx;"></view>

		<view class="top">
			<image class="topimg" src="/static/baoxiaobj.jpg" mode=""></image>
			<view class="top1">
				<view class="top1text">
					报修进度
				</view>
				<view class="xian">
					<image class="xian" src="../../../static/xian.png" mode=""></image>
				</view>
				<view class="top2">
					<view class="top2-1">
						<view class="top2-1-1">
							<image class="top2-1-1" :src="data.status==0?'../../../static/dqjd.png':'../../../static/jdd.png'" mode=""></image>
						</view>
						<view class="top2-2">
							待派工
						</view>
					</view>

					<view class="top2-1">
						<view class="top2-1-1">
							<image class="top2-1-1" style="width: 16rpx;height: 16rpx;" :src="data.status>=1?'../../../static/dqjd.png':'../../../static/jdd.png'"
								mode=""></image>
						</view>
						<view class="top2-2">
							已派工
						</view>
					</view>

					<view class="top2-1">
						<view class="top2-1-1">
							<image class="top2-1-1" style="width: 16rpx;height: 16rpx;" :src="data.status>=2?'../../../static/dqjd.png':'../../../static/jdd.png'"
								mode=""></image>
						</view>
						<view class="top2-2">
							待验收
						</view>
					</view>

					<view class="top2-1">
						<view class="top2-1-1">
							<image class="top2-1-1" style="width: 16rpx;height: 16rpx;" :src="data.status>=3?'../../../static/dqjd.png':'../../../static/jdd.png'"
								mode=""></image>
						</view>
						<view class="top2-2">
							已完成
						</view>
					</view>
				</view>

				<view class="top3" @click="closebaoxiu" v-if="data.isclose">
					取消申请
				</view>
			</view>
		</view>
		<view class="title">
			<view class="title1">
				<view class="title1-1">
					报修信息
				</view>
				<!-- <image src="/static/bangz.png" mode=""></image> -->
			</view>
		</view>

		<view class="center">
			<view class="center1">
				<view class="box1">
					<view class="box1-1">
						<view class="box1-1texte">报修类别</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.formattype}}</view>
					</view>
				</view>
				<view class="box1">
					<view class="box1-1">
						<view class="box1-1texte">报修项目</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.protitle}}</view>
					</view>
				</view>
				<view class="box1">
					<view class="box1-1">
						<view class="box1-1texte">联系人</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.name}}</view>
					</view>
				</view>
				<view class="box1">
					<view class="box1-1">
						<view class="box1-1texte">联系人电话</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.phone}}</view>
					</view>
				</view>
				<view class="box1">
					<view class="box1-1">
						<view class="box1-1texte">住址信息</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.room}}</view>
					</view>
				</view>
				<view class="box1" v-if="data.type==1">
					<view class="box1-1">
						<view class="box1-1texte">预约上门时间</view>
					</view>
					<view class="box1-2">
						<view class="box1-2text">{{data.roomtime}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="title">
			<view class="title1">
				<view class="title1-1">
					报修内容
				</view>
			</view>
		</view>

		<view class="center">
			<view class="" style="width: 20rpx;height: 4vw;"></view>
			<view class="center2">
				<view class="center1-1">
					{{data.content}}
				</view>
				
			</view>
			<view class="center3" v-if="data.pics.length>0">
				<view v-for="pic in data.pics"  @click="previewImage(k,data.pics)" style="width: 158rpx; height: 158rpx; overflow: hidden; border-radius: 10rpx;">
					<image :src="pic" mode="widthFix" style="width: 100%;" ></image>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				bartop: 0,
				id:0,
				data:{}
			}
		},
		onLoad(e) {
			that = this;
			this.bartop = this.$bartop;
			that.id = e.id
			that.getdata()
		},
		methods: {
			previewImage(index,pics) {
				wx.previewImage({
					current: pics[index],
					urls: pics //一个数组，可以查看多张图
				});
			},
			getdata(){
				that.$post('center/getbaoxiu',{id:that.id}).then(res=>{
					that.data = res.data;
				})
			},
			closebaoxiu(){
				uni.showModal({
					title:'取消提示',
					content:'确定要取消该申请吗?',
					success(e) {
						if(e.confirm){
							uni.showLoading({
								title:'正在取消'
							})
							that.$post('center/closebaoxiu',{id:that.id}).then(res=>{
								uni.hideLoading()
								uni.showModal({
									title:'提示',
									content:res.msg,
									showCancel:false,
									success(e){
										uni.navigateBack()
									}
								})
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.top {
		width: 700rpx;
		height: 320rpx;
		margin: 20rpx auto;

		.topimg {
			width: 700rpx;
			height: 320rpx;
		}

		.top1 {
			margin-top: -300rpx;

			.top1text {
				margin-left: 20rpx;
				font-size: 30rpx;
				font-family: Alibaba PuHuiTi;
				font-weight: 500;
				color: #FFFFFF;
			}
		}

		.xian {
			width: 520rpx;
			height: 4rpx;
			margin: 30rpx auto;
		}

		.top2 {
			width: 560rpx;
			height: 4rpx;
			background-color: white;
			margin: 30rpx auto;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.top2-1 {
				display: flex;
				margin-top: 14rpx;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.top2-2 {
					font-size: 18rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FFFFFF;
				}
			}
		}
	}

	.top2-1-1 {
		width: 40rpx;
		height: 40rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.top3 {
		width: 300rpx;
		margin: 0 auto;
		margin-top: 140rpx;
		text-align: center;
		font-size: 30rpx;
		font-family: Alibaba PuHuiTi;
		font-weight: 500;
		color: #FFFFFF;
	}

	.box {
		width: 90vw;
		margin: 0 auto;
		/* display: flex; */
	}

	.box1 {
		width: 90vw;
		margin: 0 auto;
		padding: 20rpx 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1rpx solid #f4f4f4;

		>image {
			width: 12rpx;
			height: 24rpx;
		}

		.box1-2 {
			display: flex;
			align-items: center;

			.box1-2text {
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #999999;
			}

			>image {
				margin-left: 10rpx;
				width: 12rpx;
				height: 24rpx;
			}

		}


		.box1-1 {
			display: flex;
			align-items: center;

			>image {
				width: 56rpx;
				height: 56rpx;
			}

			.box1-1texte {
				margin-left: 20rpx;
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #2A2A2A;
				line-height: 46rpx;
			}
		}

	}

	.title {
		width: 100vw;
		border-left: rgb(241, 145, 73) solid 6rpx;

		.title1 {
			width: 94vw;
			margin: 0 auto;
			display: flex;
			justify-content: space-between;

			.title1-1 {
				font-size: 30rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #333333;
			}

			>image {
				width: 27rpx;
				height: 27rpx;
			}
		}
	}

	.center {
		width: 94vw;
		margin: 20rpx auto;
		background-color: white;
		border-radius: 20rpx;

		.center2 {
			width: 86vw;
			height: 200rpx;
			margin: 0 auto;
			background-color: rgb(238, 238, 238);

			.center1-1 {
				padding: 3vw;
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #999999;
			}

			.center1-2 {
				position: relative;
				top: 80rpx;
				left: 76vw;
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #999999;
			}
		}

		.center3 {
			display: flex;
			width: 86vw;
			margin: 0rpx auto;
			padding: 20rpx 0;

			>image {
				margin-right: 20rpx;
				width: 158rpx;
				height: 158rpx;
			}
		}
	}
</style>
